<link rel="stylesheet" href="/static/plugins/dropzone/dropzone.css" type="text/css">
<script type="text/javascript" src="/static/plugins/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/static/plugins/dropzone/dropzone.js"></script>


<div class="dropzone" id="dropzone-dz">
    <div class="am-text-success dz-message" style="text-align:center;">
        <i class="fa fa-cloud-upload fa-5x" style="color:#3c8dbc"></i><br>拖拽要上传的文件或点击选择<br>
    </div>
</div>
<input type="hidden" id="dropzone" name="dropzone" value="">
<script type="text/javascript">
	Dropzone.autoDiscover = false;
	var myDropzone = new Dropzone("#dropzone-dz", {
		url: "/upload/img" ,
        paramName:"imgFile", //设置上传的name
        maxFiles:1,
        acceptedFiles:"image/*",//设置上传的文件格式
        uploadMultiple:false,//禁止同时上传多个文件
		success: function(file, data) {
			console.log(data);
            $("#dropzone").val(data.url);
        }
	});
</script>